using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace MathematicallySafe.HeadCounter.Converters
{
    [ValueConversion(typeof (object), typeof (Visibility))]
    public class ReferenceToVisibility : IValueConverter
    {
        public Visibility IsNull { get; set; }
        public Visibility HasValue { get; set; }

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (value == null) ? IsNull : HasValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }

        #endregion
    }
}